<?

// this class refer to addthis.com

class Control_Addthis extends QUI_Control_Abstract{
	
	function render(){
		
		if(! $this->iconNum) $this->iconNum = 5;
		
		if(! $this->width) $this->width = (36 * $this->iconNum + 40 + 60).'px'; // icon width * icon num + addthis_button width + addthis_counter width
		
		$ret = '<div class="addthis_toolbox addthis_default_style addthis_32x32_style" style="width:'.$this->width.'">';
		
		for($i=1; $i<=$this->iconNum; $i++){
			$ret .= '<a class="addthis_button_preferred_'.$i.'"></a>';
		}
		
		$ret .= '
	<a class="addthis_button_compact"></a>
	<a class="addthis_counter addthis_bubble_style"></a>
</div>
<script type="text/javascript">var addthis_config = {"data_track_clickback":true};</script>
<script type="text/javascript" src="http://s7.addthis.com/js/250/addthis_widget.js#pubid=ra-4d929e4507585058"></script>';

		return $ret;
	}
}